package
{
	
	import flash.display.*;
	import flash.events.MouseEvent;
	import mcPauseModuleSkin;
	import GameState;
	
	public class UIPauseModule extends UI
	{
		
		private var skin:mcPauseModuleSkin;
		private var state:GameState;
		private var isActive:Boolean = false;
		
		public function UIPauseModule()
		{
			
			super();
			
		}
		
		override public function init():void
		{
			
			destroy();
			skin = new mcPauseModuleSkin();
			addChild(skin);
			state = new GameState();
			state = state.getCurrentGameState();
			skin.btnQuitt.addEventListener(MouseEvent.CLICK, btnQuittClick);
			skin.btnPlayy.addEventListener(MouseEvent.CLICK, btnPlayyClick);
			
				if (skin == null)
				{
					
					isActive = false;
					
				} else {
					
					isActive = true;
					
				}
			
		}
		
		private function btnPlayyClick(e:MouseEvent):void
		{
			
			isActive = true;
			destroy();
			
		}
		
		private function btnQuittClick(e:MouseEvent):void
		{
			
			isActive = false;
			destroy();
			
		}
	}
}